package com.CST.controller;


import com.CST.common.api.ResultObject;
import com.CST.dto.InheritDTO;
import com.CST.entity.EtlAcSet;
import com.CST.service.IEtlAcSetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author xnd
 * @since 2022-01-12
 */
@Api(tags = {"账套信息"})
@RestController
@RequestMapping("/etlAcSet")

public class EtlAcSetController {

    @Autowired
    private IEtlAcSetService etlAcSetService;

    @PostMapping("/getAcSetSource")
    @ApiOperation("账套查询")
    public ResultObject getAcSetSource(@RequestBody EtlAcSet entity) {
        List<EtlAcSet> result = etlAcSetService.getAcSetSource(entity);
        return ResultObject.successReturn(result);
    }

    @ApiOperation("继承")
    @PostMapping("/inherit")
    public ResultObject inherit(@RequestBody InheritDTO dto) {
        return ResultObject.success(etlAcSetService.inherit(dto));
    }

}

